package logic

import (
	"context"
	"goods/goodsrpc/goodsrpc"
	"goods/goodsrpc/internal/svc"
	"goods/models/mysql"

	"github.com/zeromicro/go-zero/core/logx"
)

type CollectListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCollectListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CollectListLogic {
	return &CollectListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CollectListLogic) CollectList(in *goodsrpc.CollectListRequest) (*goodsrpc.CollectListResponse, error) {
	// todo: add your logic here and delete this line

	var collect mysql.CollData
	mysql.DB.Debug().Find(&collect)
	return &goodsrpc.CollectListResponse{
		GoodsId: collect.GoodsId,
	}, nil
}
